Precondition Satisfaction by Smart Object Selection in Random Testing

نویسندگان

  • Serge Gebhardt
  • Yi Wei
  • Bertrand Meyer
چکیده

A random testing strategy for object-oriented software constructs test runs by repeatedly performing the following three tasks: 1) randomly select a method under test (MUT); 2) randomly select or construct target or argument objects to feed to the chosen method; 3) invoke the test case. Usually all the objects created for or returned by a MUT are stored in an object pool for reuse by future test cases. When testing contract-equipped software it becomes difficult for a random testing strategy to select input objects that satisfy the MUT’s preconditions. The generated test cases often fail the preconditions and thus some methods are rarely tested (if at all). We propose an improvement to random testing through a smarter selection of objects in order to satisfy more preconditions. All predicates appearing in the classes under test are collected into a pool and evaluated on the objects involved in each test case invocation. Predicates are mapped to satisfying object combinations in the pool and can be easily selected as input upon a test case invocation in order to satisfy the MUT’s preconditions. Our results show that the improved strategy does indeed test more methods, especially where the original approach was failing. However we could not observe a stable increase in the number of found faults. Acknowledgments My gratitude goes to my supervisor Yi Wei for his continuous support, interesting discussions, and valuable feedback, to Prof. Bertrand Meyer for giving me the opportunity to work on this interesting topic, and to my family which supported me during my whole time at ETH.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Integrating Random Testing with Constraints for Improved Efficiency and Diversity

Random testing can be fully automated, eliminates subjectiveness in constructing test cases, and increases the diversity of test data. However, randomly generated tests may not satisfy program’s assumptions (e.g., method preconditions). While constraint solving can satisfy such assumptions, it does not necessarily generate diverse tests and is hard to apply to large programs. We blend these tec...

متن کامل

Using Contracts and Boolean Queries to Improve the Quality of Automatic Test Generation

Since test cases cannot be exhaustive, any effective test case generation strategy must identify the execution states most likely to uncover bugs. The key issue is to define criteria for selecting such interesting states. If the units being tested are classes in object-oriented programming, it seems attractive to rely on the boolean queries present in each class, which indeed define criteria on...

متن کامل

Distributed Black-Box Software Testing Using Negative Selection

In the software development process, testing is one of the most human intensive steps. Many researchers try to automate test case generation to reduce the manual labor of this step. Negative selection is a famous algorithm in the field of Artificial Immune System (AIS) and many different applications has been developed using its idea. In this paper we have designed a new algorithm based on nega...

متن کامل

Smart meters: A users' view

Smart meters are assumed to contribute to energy conservation by providing updated consumption data to energy utilities, but, given their pervasive presence in consumers’ homes, they could also provide timely feedback to energy consumers/users. A precondition, however, is that smart meters are really usable to lay consumers. In the present study 40 participants were videorecorded while performi...

متن کامل

A Formal Model of Robustness Testing for an Object-Oriented Specification

The work presented in this paper proposes a formal model of constraints for testing the conformity of an implementation from its specification. The principal idea of our approach is based on an equivalence partitioning of input domains for each method type in an object oriented (OO) paradigm for detecting the different classes of errors. The main contribution of our approach is the use of inval...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009